PAY ROLL

prepare("select * from payroll") ; $getall->execute() ; $count = 0 ; $gsa = array() ; $nets = array() ; $txarray = array() ; while($row = $getall->fetch(pdo::FETCH_ASSOC)) { $count++ ; ?> prepare("select * from staff_table where staff_id_no =:a") ; $stname->bindparam(":a",$stf) ; $stname->execute() ; $rname = $stname->fetch(pdo::FETCH_ASSOC) ; $staffname = $rname['names'] ; ?>
SN STAFF_ID STAFF NAME POSITION BS TA HA WA MA OA GS TAX LD SA OD NET SALARY
prepare("select * from deductions where ((staff_id = '$stf' and deduction = 'LD') and (pyear='$dy' and pmonth='$dm'))") ; $loan->execute() ; if($loan->rowcount() > 0) { $lrow = $loan->fetch(pdo::FETCH_ASSOC) ; $lds =$lrow['amount'] ; } else { $lds = 0 ; } echo $lds ; ?> prepare("select * from deductions where ((staff_id = '$stf' and deduction = 'SA') and (pyear='$dy' and pmonth='$dm'))") ; $sad->execute() ; if($sad->rowcount() > 0) { $lrows = $sad->fetch(pdo::FETCH_ASSOC) ; $sads =$lrows['amount'] ; } else { $sads = 0 ; } echo $sads ; ?> prepare("select * from deductions where ((staff_id = '$stf' and deduction = 'OD') and (pyear='$dy' and pmonth='$dm'))") ; $odd->execute() ; if($odd->rowcount() > 0) { $orow = $odd->fetch(pdo::FETCH_ASSOC) ; $oddn =$orow['amount'] ; } else { $oddn = 0 ; } echo $oddn ; ?>
                    Total Gross :N Total Tax :N       Total NS :N